#include "cabin.h"

using namespace tp1;

Cabin::Cabin(float base,float height)
	:Object3D(base)
{
	m_base = base;
	m_height = height;

	m_heightCone = 0.25f*m_height;
	m_radiusCone = base/(2*sinf(Mathematic::M_PI/4.0f));

	m_sidesCone = 4;
}


Cabin::~Cabin(void)
{
}

void Cabin::Render()
{		
	glPushMatrix();
		Translate(0,0,-m_heightCone);
		glPushMatrix();
			glPushMatrix();
				Rotate(45,0,0,1);
				glutSolidCone(m_radiusCone,m_heightCone,4,1);
			glPopMatrix();
			Translate(0,0,-m_base/2.0f);
			glutSolidCube(m_base);
		glPopMatrix();
	glPopMatrix();
}